//
//  WFBaseScrollView.m
//  谷居
//
//  Created by dllo on 16/6/16.
//  Copyright © 2016年 刘万方. All rights reserved.
//

#import "WFBaseScrollView.h"

@implementation WFBaseScrollView
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self setColor];
        [self addObserver];
    }
    return self;
}

- (void)setColor {
    if (!IS_LONG) {
        self.backgroundColor = DAY_COLOR;
    } else {
        self.backgroundColor = NIGHT_COLOR;
    }

}

- (void)addObserver {
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeToNight:) name:@"夜间模式" object:nil];

}
-(void)changeToNight:(NSNotification *)sender {
    if (!IS_LONG) {
        self.backgroundColor = NIGHT_COLOR;
    } else {
        self.backgroundColor = DAY_COLOR;
    }
}
- (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
    [super dealloc];
}
@end
